package io.finer.erp.jeecg.bas.service;

import io.finer.erp.jeecg.bas.entity.BasWarehouse;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.exception.JeecgBootException;

/**
 * @Description: 仓库
 * @Author: jeecg-boot
 * @Date:   2020-04-01
 * @Version: V1.0
 */
public interface IBasWarehouseService extends IService<BasWarehouse> {

	/**根节点父ID的值*/
	public static final String ROOT_PID_VALUE = "0";
	
	/**树节点有子节点状态值*/
	public static final String HASCHILD = "1";
	
	/**树节点无子节点状态值*/
	public static final String NOCHILD = "0";

	/**新增节点*/
	void addBasWarehouse(BasWarehouse basWarehouse);
	
	/**修改节点*/
	void updateBasWarehouse(BasWarehouse basWarehouse) throws JeecgBootException;
	
	/**删除节点*/
	void deleteBasWarehouse(String id) throws JeecgBootException;
	
	/**
	 * @Description 根据传入的仓库ID判断该仓库是否可以生产出库 代加工库、废料库、成品库中的物料不可以进行生产
	 * @param id
	 * @return
	 * Create at: 2020-10-21 08:59:54
	 * @author: duany
	 * Revision:
	 *    2020-10-21 08:59:54 - first revision by duany
	 *        
	 */
	boolean checkWarehouseProduce(String id);
	
	/**
	 * @Description 检查出库仓库是否为成品库，如果不是返回false并且不能进行销售出库。
	 * @param id
	 * @return
	 * Create at: 2020-11-03 10:44:37
	 * @author: duany
	 * Revision:
	 *    2020-11-03 10:44:37 - first revision by duany
	 *        
	 */
	boolean checkWarehouseSaleOut(String id);
	
	/**
	 * @Description 获取仓库的根节点
	 * @param id
	 * @return
	 * Create at: 2020-11-03 10:46:34
	 * @author: duany
	 * Revision:
	 *    2020-11-03 10:46:34 - first revision by duany
	 *        
	 */
	public BasWarehouse getRootWarehouse(String id);

}
